import Vue from 'vue'
import VueRouter from 'vue-router'
import About from '@/pages/About.vue'
import Home from '@/pages/Home.vue'
import News from '@/pages/News.vue'
import Message from '@/pages/Message.vue'

Vue.use(VueRouter)

//创建一个router，用于控制整个应用的路由规则
const router = new VueRouter({
	mode:'history',
	routes:[
		{
			path:'/about',
			component:About
		},
		{
			path:'/home',
			component:Home,
			children:[
				{
					path:'message',
					component:Message
				},
				{
					path:'news',
					component:News
				}
			]
		}
	]
})

export default router